


#include <iostream>
#include <opencv2/highgui/highgui.hpp>
#include <opencv2/core/core.hpp>

using namespace std;
using namespace cv;

int main(int argc, char** argv)
{
    FileStorage fs_read("../yml/array.yml", FileStorage::READ);

    cv::FileNode features = fs_read["features"];
    cv::FileNodeIterator it = features.begin(), it_end = features.end();
    int idx = 0;
    std::vector<uchar> lbpval;

    //iterator through a sequence using FileNodeIterator
    for (; it != it_end; ++it, idx++)
    {
        std::cout << "feature #" << idx << ": ";
        std::cout << "x=" << (int)(*it)["x"] << ", y=" << (int)(*it)["y"] << ", lbp: (";
        (*it)["lbp"] >> lbpval;
        for (int i = 0; i < (int)lbpval.size(); i++)
            std::cout << " " << (int)lbpval[i];
        std::cout << ")" << std::endl;
    }
    fs_read.release();
}


